#include "MyUtils.h"

#include <stdarg.h>   // va_list

#include <stdio.h>
void checkPlatform(){
#ifdef _WIN32
    printf("This is Windows platform.\n");
#elif __linux__
    printf("This is Linux platform.\n");
#elif __unix__
    printf("This is Like Unix platform.\n");
#else
    printf("This is Uknow platform.\n");
#endif

    printf("short %d\n", sizeof(short));
    printf("int %d\n", sizeof(int));
    printf("short int %d\n", sizeof(short int));
    printf("long int %d\n", sizeof(long int));
    printf("long %d\n", sizeof(long));
    printf("long long %d\n", sizeof(long long));

}


void splicString(char *dst, int len, int argc, ...){
    memset(dst,1, len);
    va_list args;
    va_start(args, argc);
    char *next = 0;
    for(int i =0; i< argc; ++i){
        next = va_arg(args, char*);
        strcat(dst, next);
    }
    va_end(args);
}

#include <time.h>
int getRandomInt(int start, int end){
    int randomNum = 0;
    // 使用当前时间设置种子
    srand((unsigned int)time(NULL));
    randomNum = rand() % (end + 1 - start) + start;

    return randomNum;
}


